#!/bin/bash

IP=$1

[ -z "$IP" ] && echo "$0 <ip or ip range>" && exit

nmap "$IP"  -oG - -p 22 --open | awk '/^[^#].*Ports/ {print $2}' > /tmp/host.list

while read i
do
 ./ssh_login_detect.exp $i
done < /tmp/host.list

rm -f /tmp/host.list


